package tgc.edu.exam.entity;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

import org.springframework.data.annotation.CreatedBy;

import com.fasterxml.jackson.annotation.JsonIgnore;

import tgc.edu.exam.custom.BaseEntity;

/****
 * 班级活动
 * 
 * @author Administrator
 *
 */
@Entity
public class ActivityClass extends BaseEntity<UUID> {

	private TbClass tbClass;
	private String motif;// 活动主题
	private String begintime;// 开始时间
	private String overtime;// 结束时间
	@JsonIgnore
	private List<Student> students = new ArrayList<>();
	private String content;// 活动内容
	private String summarize;// 活动总结

	@ManyToOne
	@CreatedBy
	public TbClass getTbClass() {
		return tbClass;
	}

	public void setTbClass(TbClass tbClass) {
		this.tbClass = tbClass;
	}

	public String getMotif() {
		return motif;
	}

	public void setMotif(String motif) {
		this.motif = motif;
	}

	public String getBegintime() {
		return begintime;
	}

	public void setBegintime(String begintime) {
		this.begintime = begintime;
	}

	public String getOvertime() {
		return overtime;
	}

	public void setOvertime(String overtime) {
		this.overtime = overtime;
	}

	@OneToMany(cascade=CascadeType.ALL,mappedBy="activityClass")
	public List<Student> getStudents() {
		return students;
	}

	public void setStudents(List<Student> students) {
		this.students = students;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getSummarize() {
		return summarize;
	}

	public void setSummarize(String summarize) {
		this.summarize = summarize;
	}

}
